{if $full_page eq 1}
<!DOCTYPE HTML>
<html>
<head>
{include file='html_header.htm'}
<script lang='javascript' type='text/javascript'>
      Zepto(function($)
      {
        $('#hidebg').css('height',$('body').height());
      });
      
      function open_surplus(){
        
        $('#hidebg').fadeIn(200,function()
        {
         $('#popup_window').fadeIn(200);
        });
      }
      
      function close_surplus(){
         $('#popup_window').fadeOut(200,function()
        {
         $('#hidebg').fadeOut(200);
        });
      }
      
      function toggle_message()
      {
        $("#user_message_div").slideToggle();
      }
      
    </script>
</head>
<body>
<div id='container'>
{/if}
      {include file='page_header.htm'}
<form  action="back.php?act=operate" method="post">      
<section style="padding-bottom:60px;">
{if $back_order.image_arr}
<div id="hidebg" onclick='close_surplus()'></div>
<div id="popup_window" style="position:fixed;display:none;"> <a class='close' onclick="close_surplus()"></a>
  <div class="buyer">
    <div class="info info_img"> {foreach from=$back_order.image_arr item=img} <img src="{$img}" /> {/foreach} </div>
  </div>
</div>
{/if}
<div class="back_info_con">
<div class="order_pass">
  <p class="edit"><span>{$lang.base_info}</span></p>
  <div class="order_pass_info">
    <table width="100%" >
      <tr>
        <td width="18%"><div>{$lang.label_order_sn}</div></td>
        <td width="34%">{$back_order.order_sn}</td>
      </tr>
      <tr>
        <td><div>{$lang.label_order_time}</div></td>
        <td>{$base_order.add_time}</td>
      </tr>
      <tr>
        <td width="18%"><div>服务类型</div></td>
        <td width="34%"> {if $back_order.back_type eq 1}退货{/if}
          {if $back_order.back_type eq 2}换货{/if}
          {if $back_order.back_type eq 3}维修{/if}
          {if $back_order.back_type eq 4}退款（无需退货）{/if} </td>
      </tr>
      <tr> 
        <td><div>退款方式</div></td>
        <td> {if $back_order.back_pay eq 1}退款至账户余额{/if}
          {if $back_order.back_pay eq 2}原支付方式返回{/if} </td>
      </tr>
      <tr>
        <td><div>{$lang.label_user_name}</div></td>
        <td>{$back_order.user_name|default:$lang.anonymous}</td>
      </tr>
      <tr> 
        <td><div>{$lang.label_how_oos}</div></td>
        <td>{$base_order.how_oos}</td>
      </tr>
      <tr>
        <td><div>{$lang.label_shipping}</div></td>
        <td>{if $base_order.shipping_id > 0}{$base_order.shipping_name}{/if} </td>
      </tr>
      <tr> 
        <td><div>{$lang.label_shipping_fee}</div></td>
        <td>{$base_order.shipping_fee}</td>
      </tr>
      <tr>
        <td><div>{$lang.label_insure_yn}</div></td>
        <td>{if $base_order.insure_yn}{$lang.yes}{else}{$lang.no}{/if}</td>
      </tr>
      <tr> 
        <td><div >{$lang.label_insure_fee}</div></td>
        <td>{$base_order.insure_fee|default:0.00}</td>
      </tr>
      <tr>
        <td><div >{$lang.label_invoice_no}</div></td>
        <td >{$base_order.invoice_no}</td>
      </tr>
      <tr> 
        <td><div >{$lang.label_shipping_time}</div></td>
        <td>{$base_order.shipping_time}</td>
      </tr>
    </table>
  </div>
</div>
<div class="order_pass">
  <p class="edit"><span>{$lang.back_info}</span></p>
  <div class="order_pass_info">
    <table width="100%" >
      <tr>
        <td><div>申请退货/维修时间</div></td>
        <td>{$back_order.formated_add_time}</td>
      </tr>
      <tr>
        <td><div >申请人用户名</div></td>
        <td>{$back_order.user_name}</td>
      </tr>
      <tr>
        <td><div>换回商品收件人</div></td>
        <td>{$back_order.consignee|escape}</td>
      </tr>
      <tr>
        <td><div>联系电话</div></td>
        <td>{$base_order.tel}</td>
      </tr>
      <tr>
        <td><div>换回商品收货人地址</div></td>
        <td >{$back_order.address|escape}</td>
      </tr>
      <tr>
        <td><div>邮编</div></td>
        <td>{$back_order.zipcode|escape}</td>
      </tr>
      <tr>
        <td><div>退货/维修原因</div></td>
        <td colspan=3>{$back_order.back_reason}</td>
      </tr>
      <tr>
        <td><div>用户退回商品所用快递</div></td>
        <td>{$back_order.shipping_name|escape}</td>
      </tr>
      <tr>
        <td><div>运单号</div></td>
        <td>{$back_order.invoice_no}</td>
      </tr>
      {if $back_order.image_arr}
      <tr>
        <td><div>图片</div></td>
        <td><a href="javascript:open_surplus();" style='color : #FFC486;'>查看图片</a></td>
      </tr>
      {/if}
    </table>
  </div>
</div>
{if $back_order.postscript || $back_order.back_reply}
<div class="order_qita" onclick='toggle_message();'>
  <p class="edit" id="order_qita"><span>客户留言</span><i></i></p>
  <div class="qita_info qita_info_t" id='user_message_div'>
    <table width="100%" >
      {if $back_order.postscript}
      <tr>
        <td width='10%' align='left'>用户：</td>
        <td width='65%' align='left'>{$back_order.postscript}[{$back_order.formated_add_time}]</td>
      </tr>
      {/if}
      {foreach from=$back_order.back_reply item=reply}
      <tr> {if $reply.type eq 1}
        <td width='10%' align='left'>用户：</td>
        {else if $reply.type eq 0}
        <td width='10%' align='left'>客服：</td>
        {/if}
        <td width='65%' align='left'>{$reply.message}[{$reply.add_time}]</td>
      </tr>
      {/foreach}
    </table>
  </div>
</div>
{/if}
<div class="order_pass">
  <p class="edit"><span>原订单-商品信息</span></p>
  <div class="order_pass_info">
    <div class="order_pass_info">
        {foreach from=$order_goods item=goods}
        <div class="order_goods_info" style="{if $smarty.foreach.name.first}padding-top:0; border-top:0;{/if}">
            <div class="goods_name">
                <strong>{$goods.goods_name}</strong>
                <span>{$lang.goods_sn}：{$goods.goods_id}</span>
                <span>{$lang.product_sn}：{$goods.product_id}</span>
            </div>
            <div class="goods_num">
                <span>{$goods.goods_attr|nl2br}</span>
                <em>x{$goods.send_number}</em>
            </div>
        </div>
        {/foreach}
	</div>
  </div>
</div>
<div class="order_pass">
  <p class="edit"><span>退货/返修 - 商品信息</span></p>
  <div class="order_pass_info">
      {foreach from=$goods_list item=goods name=name}
      <div class="order_goods_info" style="border-top:1px solid #eee;{if $smarty.foreach.name.first}padding-top:0; border-top:0;{/if}">
        <div class="goods_name">
            <strong>{if $goods.goods_id gt 0 && $goods.extension_code neq 'package_buy'}{if $goods.brand_name}<i>[ {$goods.brand_name} ]</i>{/if}{$goods.goods_name}{/if}</strong>
            <span>{$lang.goods_sn}：{$goods.goods_id}</span>
            <span>{$lang.product_sn}：{$goods.product_id}</span>
        </div>
        <div class="goods_num">
            <span>{$goods.goods_attr|nl2br}</span>
            <em>x{$goods.back_goods_number}</em>
        </div>
        <div style="clear:both;"></div>
        <div class="order_goods_bottom"><span class="fl">应退金额：<i>{$goods.back_goods_money}</i></span>{if $goods.back_type_name}<span class="fr">业务：{$goods.back_type_name}</span>{/if}</div>
	  </div>
      {/foreach}
  </div>  
</div>
<div class="order_pass">
    <p class="edit"><span>操作备注</span></p>
    <textarea name="action_note" style="width:100%;"></textarea>
</div>
<div class="operate">
<table width="100%" >
  <tr>
   {if $back_order.status_back lt 6}
   {if $back_order.status_back eq 5}
   {if $operable_list.ok}
    <input name="ok" type="submit" value="通过申请" class="button" />
    {/if}
    {if $operable_list.no}
    <input name="no" type="submit" value="拒绝申请" class="button" />
    {/if}
    {else}
    <td> {if $operable_list.confirm && $back_order.back_type neq 4 && $back_order.status_back eq 0 && ($back_order.status_refund eq 0 || $back_order.status_refund eq 9)}
      <input name="confirm" type="submit" value="收到用户寄回商品" class="button" />
      {/if} 
      {if ($back_order.back_type eq 4 || ($back_order.back_type eq 1 && ($back_order.status_back eq 1 || $back_order.status_back eq 2))) && ($back_order.status_refund eq 0 || $back_order.status_refund eq 9)}
      <input name="refund" type="submit" value="去退款" class="button" />
      {/if}
        {if $operable_list.backshipping && $back_order.back_type eq 3 && $back_order.status_back eq 1}
        <input name="backshipping" type="submit" class="button" value="换出商品寄出" />
        {/if}
      {if $operable_list.backfinish && ($back_order.status_refund eq 1 || $back_order.status_back eq 2)}
      <input name="backfinish" type="submit" value="完成退换货" class="button" />
      {/if}
      {/if}
      <input name="after_service" type="submit" value="{$lang.op_after_service}" class="button" />
      <input name="back_id" type="hidden" value="{$smarty.request.back_id}"  class='button'></td>
    	{else}
		{if $back_order.status_back eq 6}
		此单已被管理员拒绝
		{/if}
		{if $back_order.status_back eq 7}
		此单已被系统取消
		{/if}
		{if $back_order.status_back eq 8}
		此单已被用户自行取消
		{/if}
	{/if}
  </tr>
</table>

<script>
//$(function(){
//	$('.operate input').first().css('margin',0)
//})
</script>
</div>
</div>
</section>
</form>
{include file='page_footer.htm'}
      {if $full_page eq 1}
</div>
{include file='static_div.htm'}
</body>
</html>
{/if}